Documet details
The Invoice API provides key functionalities:
- Get the status from the government for the e-invoice
Endpoint
- Base URL:
malaysia-sandbox.complyance.io
- Documet details API:
/getDocumentDetailsFromLHDN
Headers
Header | Type | Description | Example |
---|---|---|---|
x-api-key | string | API Key for authentication | 1aN3AQ8ZsggJ0UABAHXVB |
invoiceMethod | string | The method of invoicing (e.g., non-peppol) | non-peppol |
Content-Type | string | Defines that the body is in JSON format | application/json |
- Shell
- Javascript
- Ruby
- Python
- PHP
- Java
- Go
curl --location 'https://malaysia-sandbox.complyance.io/getDocumentDetailsFromLHDN'
--header 'x-api-key: k4PW_J0s8DtBSdvYnadXn' \
--header 'Content-Type: application/json'
const headers = {
'x-api-key': 'k4PW_J0s8DtBSdvYnadXn',
'Content-Type': 'application/json'
};
fetch('https://malaysia-sandbox.complyance.io/getDocumentDetailsFromLHDN', {
method: 'POST',
headers: headers
})
.then(function(response) {
return response.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
headers = {
'x-api-key' => 'k4PW_J0s8DtBSdvYnadXn',
'Content-Type' => 'application/json'
}
response = RestClient.post 'https://malaysia-sandbox.complyance.io/getDocumentDetailsFromLHDN', {}, headers
puts response.body
import requests
headers = {
'x-api-key': 'k4PW_J0s8DtBSdvYnadXn',
'Content-Type': 'application/json'
}
response = requests.post('https://malaysia-sandbox.complyance.io/getDocumentDetailsFromLHDN', headers=headers)
print(response.json())
<?php
$headers = [
'x-api-key' => 'k4PW_J0s8DtBSdvYnadXn',
'Content-Type' => 'application/json'
];
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://malaysia-sandbox.complyance.io/getDocumentDetailsFromLHDN', [
'headers' => $headers
]);
echo $response->getBody()->getContents();
?>
URL url = new URL("https://malaysia-sandbox.complyance.io/getDocumentDetailsFromLHDN");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("x-api-key", "k4PW_J0s8DtBSdvYnadXn");
con.setRequestProperty("Content-Type", "application/json");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"net/http"
)
func main() {
headers := map[string][]string{
"x-api-key": []string{"k4PW_J0s8DtBSdvYnadXn"},
"Content-Type": []string{"application/json"},
}
req, err := http.NewRequest("POST", "https://malaysia-sandbox.complyance.io/getDocumentDetailsFromLHDN", nil)
if err != nil {
// Handle error
}
for key, values := range headers {
for _, value := range values {
req.Header.Add(key, value)
}
}
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
// Handle error
}
defer resp.Body.Close()
}
Request Body
The request body for the Document detail should be structured as follows:
{
"documentUuid": "ZG9KWZ1Q2BPSG9XWMN4485AJ10"
}
Request Body Fields
Field | Type | Description | Example |
---|---|---|---|
documentUUID | string | Unique identifier received from government as an acknowledgement |
Sample Response Body
Success Response (HTTP 200 OK)
{
"uuid": "CR10K32STZXCE46MFXS62EEJ10",
"submissionUid": "3RBHHC1YPZCDCA95FXS62EEJ10",
"longId": "",
"typeName": "Invoice",
"typeVersionName": "Version 1",
"issuerTin": "C58794843040",
"issuerName": "Name of Supplier",
"receiverId": "C21540299050",
"receiverName": "ABC company",
"dateTimeReceived": 1733491386000,
"dateTimeValidated": 1733491386000,
"totalExcludingTax": 1000,
"totalDiscount": 0,
"totalNetAmount": 0,
"totalPayableAmount": 1060,
"status": "Invalid",
"createdByUserId": "C58794843040:01c8ede8-5782-44c8-87ee-d547639631ad",
"documentStatusReason": null,
"cancelDateTime": null,
"rejectRequestDateTime": null,
"validationResults": {
"status": "Invalid",
"validationSteps": [
{
"status": "Valid",
"error": null,
"name": "Step03-Duplicated Submission Validator"
},
{
"status": "Invalid",
"error": {
"propertyName": null,
"propertyPath": null,
"errorCode": "Error04",
"error": "Step04-Invalid Code Field Validator",
"errorMs": "Step04-Pengesah Medan Kod Tidak Sah",
"innerError": [
{
"propertyName": "cbc:IndustryClassificationCode",
"propertyPath": "/ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cbc:IndustryClassificationCode",
"errorCode": "CV302",
"error": "ItemCode 1111 does not exist in CodeType MSIC Codes",
"errorMs": "Kod Item 1111 tidak wujud dalam Jenis Kod MSIC Codes",
"innerError": null
}
]
},
"name": "Step04-Code Field Validator"
},
{
"status": "Valid",
"error": null,
"name": "Step05-Taxpayer Profile Validator"
},
{
"status": "Valid",
"error": null,
"name": "Step06-Document References Validator"
},
{
"status": "Valid",
"error": null,
"name": "Step07-Document Currency Validator"
}
]
},
"internalId": "Invoice- 01",
"dateTimeIssued": 1733279400000
}
Server Error Response (HTTP 500 Internal Server Error)
{
"status": "error",
"message": "Internal server error. Please try again later."
}
Response Fields:
- status: Indicates the status of the API call (e.g.,
"success"
,"error"
). - message: A human-readable message providing further information about the result.
Responses
Status Code | Description |
---|---|
200 OK | Invoice data validated successfully. |
400 Bad Request | Invalid or malformed request. |
500 Internal Server Error | An error occurred on the server. |